﻿@using Microsoft.AspNetCore.Components
@using BV.PACS.WEB.Shared.Models
@using BV.PACS.WEB.Client.Services.Api
@using BV.PACS.WEB.Client.Shared.Components


@inherits BV.PACS.WEB.Client.Materials.MaterialTrackingPanelCode
<div class="row">
    @if (TrackingObject != null)
    {
        <DxFormLayout CaptionPosition="@CaptionPosition.Vertical">
            <DxFormLayoutItem Caption="@Translations.MaterialBarcode" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@MaterialBarcode"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.SourceBarcode" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@SourceBarcode"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            @if (Templates != null)
            {
                <DxFormLayoutItem Caption="@Translations.MaterialTemplateName" ColSpanLg="6" ColSpanMd="12">
                    <Template>
                        <DxComboBox Data="@Templates"
                                    TextFieldName="Name"
                                    NullText="@PacsMessagesTranslations.SelectTemplate"
                                    @bind-SelectedItem="@Template">
                        </DxComboBox>
                    </Template>
                </DxFormLayoutItem>
            }

            <DxFormLayoutItem Caption="@Translations.ParentMaterialBarcode" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@ParentMaterialBarcode"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.MaterialRegistrationDate" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxDateEdit @bind-Date="@MaterialRegistrationDate"></DxDateEdit>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.MaterialType" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <SourceMaterialTree Data="@MaterialTypes"
                                        SelectedItem="@MaterialTypeSelectedItem"
                                        OnCancel="@MaterialTypeCancelled"
                                        OnSelect="@MaterialTypeSelected">

                    </SourceMaterialTree>
                </Template>
            </DxFormLayoutItem>
            <DxFormLayoutItem Caption="@Translations.MaterialPointOfOrigin" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@MaterialPointOfOrigin"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.MaterialOwnerName" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@MaterialOwnerName"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.MaterialNote" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@MaterialNote"></DxTextBox>
                </Template>
            </DxFormLayoutItem>


        </DxFormLayout>
    }

</div>

